//
//  Copyright (C) 2010 Vadim Ushakov
// 
//  This program is free software; you can redistribute it and/or modify it
//  under the terms of the GNU General Public License as published by the Free
//  Software Foundation; either version 2 of the License, or (at your option)
//  any later version.
// 
//  This program is distributed in the hope that it will be useful, but
//  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
//  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
//  for more details.
//  
//  You should have received a copy of the GNU General Public License along
//  with this program; if not, write to the Free Software Foundation, Inc.,
//  59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//

#include "bootParameters.h"
#include "kernelMain.h"
#include "loaderInfo.h"
#include <string.h>

void entryPoint(unsigned virtualAddress, unsigned physicalAddress, unsigned kernelMemory, loaderInfoStruct *info) __attribute__((noreturn));

// A copy of the OS loader info structure
static loaderInfoStruct osLoaderInfo;

extern unsigned kernelPhysicalAddress;
extern unsigned kernelVirtualAddress;

void entryPoint(unsigned virtualAddress, unsigned physicalAddress, unsigned kernelMemory, loaderInfoStruct *info)
{
	kernelPhysicalAddress = physicalAddress;
	kernelVirtualAddress  = virtualAddress;
	memcpy(&osLoaderInfo, info, sizeof(loaderInfoStruct));
	kernelMain(kernelMemory, &osLoaderInfo);
}

